package com.ehome.poct.core.service.mapping;

import com.ehome.poct.base.api.dto.account.TermAgentOrgDTO;
import com.ehome.poct.base.api.dto.doctor.ClinicDTO;
import com.ehome.poct.core.api.constant.enums.OrderType;
import com.ehome.poct.core.api.dto.order.TestOrderItemDTO;
import com.ehome.poct.core.api.dto.order.UnificationShareAccountDTO;
import com.ehome.poct.core.api.dto.report.ProfitDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.math.BigDecimal;

/**
 * @auther: kuiba.peng
 * @date: 2022/11/23 14:32
 * @description:
 */
@Mapper(componentModel = "spring", imports = {OrderType.class, BigDecimal.class})
public interface TestShareAccountMapping {


    @Mapping(target = "stripTypeCode", source = "orderItemDTO.stripTypeCode")
    @Mapping(target = "stripName", source = "orderItemDTO.orderItemName")
    @Mapping(target = "total", source = "orderItemDTO.fee")
    @Mapping(target = "yhCost", source = "profitDTO.yhCost")
    @Mapping(target = "yhProfits", source = "profitDTO.yhProfits")
    @Mapping(target = "clinicProfits", source = "profitDTO.clinicProfits")
    @Mapping(target = "salesProfits", source = "profitDTO.salesProfits")
    @Mapping(target = "cityAgentProfits", source = "profitDTO.cityagentProfits")
    @Mapping(target = "provAgentProfits", source = "profitDTO.provagentProfits")
    @Mapping(target = "companyAgentProfits", source = "profitDTO.companyagentProfits")
    @Mapping(target = "clinicId", source = "clinicDTO.termClinicId")
    @Mapping(target = "salesId", source = "clinicDTO.termAgentId")
    @Mapping(target = "cityAgentId", source = "agentOrgDTO.cityAgentId")
    @Mapping(target = "provAgentId", source = "agentOrgDTO.provinceAgentId")
    @Mapping(target = "companyAgentId", source = "agentOrgDTO.divisionAgentId")
    @Mapping(target = "deviceType", source = "orderItemDTO.deviceType")
    UnificationShareAccountDTO toShareAccount(ClinicDTO clinicDTO, TestOrderItemDTO orderItemDTO, ProfitDTO profitDTO, TermAgentOrgDTO agentOrgDTO);
}
